package com.system.manager.modules.development.controller;


import com.system.manager.common.annotation.PreAuthorize;
import com.system.manager.common.entity.Result;
import com.system.manager.modules.authorized.enums.SubjectType;
import com.system.manager.modules.development.entity.DeveClass;
import com.system.manager.modules.development.entity.DevePurchase;
import com.system.manager.modules.development.service.IDeveClassService;
import com.system.manager.modules.development.service.IDevePurchaseService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yxp
 * @since 2021-11-17
 */
@RestController
@RequestMapping("/development/deve-class/")
public class DeveClassController {
    @Autowired
    private IDeveClassService deveClassService;

    @ApiOperation("新建项目归档")
    @PreAuthorize(SubjectType.PROJECT_LEADER)
    @PostMapping("insert/class")
    public Result insertClass(@RequestBody DeveClass deveClass){
        try {
            deveClassService.insertClass(deveClass);
            return Result.ok();
        }catch (Exception e){
            e.printStackTrace();
            return Result.error();
        }
    }


}
